package com.lucky.common.base;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.Random;

//@Service
public class BaseService<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> {

	public Logger log = LoggerFactory.getLogger(BaseService.class);

	@Resource
	protected JdbcTemplate jdbc;

	public String getAID() {
		String str = "1234567890qwertyuiopasdfghjklzxcvbnm";
		Random r = new Random();
		
		StringBuffer sb = new StringBuffer(16);
		
		for(int i=0;i<16;i++) {
			int index = r.nextInt(str.length());
			sb.append(str.charAt(index));
		}
		return sb.toString();
	}

}
